cmake_minimum_required(VERSION 3.0.2)
project(global_smoother)

## Compile as C++11, supported in ROS Kinetic,melodic
##Compile as C++14, supported in ROS nortic
add_compile_options(-std=c++14)

file(GLOB_RECURSE SRC_FILE     
  ${PROJECT_SOURCE_DIR}/src/*.cpp 
)


## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
  roscpp
  std_msgs
  nav_msgs
  geometry_msgs
  waypoint_msgs
  tf
  tf2_ros
  tf2_geometry_msgs
)
find_package(Eigen3 QUIET)
find_package(OsqpEigen QUIET)
find_package(yaml-cpp REQUIRED)


link_directories(/usr/local/lib64)

catkin_package(
  INCLUDE_DIRS include
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
  include
  include/common
  /usr/local/include/adolc
  ${catkin_INCLUDE_DIRS}
  ${Boost_INCLUDE_DIRS}
)


## 添加可执行文件编译规
add_executable(global_smoother_node ${SRC_FILE})

## 链接所需的库
target_link_libraries(global_smoother_node
  ${catkin_LIBRARIES} osqp adolc ipopt glog yaml-cpp)
